package com.ddwl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2020/3/9 16:51
 */
public interface WalletEnum {

    @AllArgsConstructor
    @Getter
    enum WxCardEnum {

        CODE_TYPE_TEXT("文本"),
        CODE_TYPE_BARCODE("一维码"),
        CODE_TYPE_QRCODE("二维码"),
        CODE_TYPE_ONLY_QRCODE("仅显示二维码"),
        CODE_TYPE_ONLY_BARCODE("仅显示一维码"),
        CODE_TYPE_NONE("不显示任何码型"),

        DATE_TYPE_PERMANENT("永久有效类型"),
        DATE_TYPE_FIX_TIME_RANGE("固定时长有效类型"),
        DATE_TYPE_FIX_TERM("固定日期有效类型"),

        FIELD_NAME_TYPE_LEVEL(""),
        FIELD_NAME_TYPE_COUPON(""),
        FIELD_NAME_TYPE_STAMP(""),
        FIELD_NAME_TYPE_DISCOUNT(""),
        FIELD_NAME_TYPE_ACHIEVEMEN(""),
        FIELD_NAME_TYPE_MILEAGE(""),

        QR_CARD("创建二维码"),
        QR_SCENE("临时二维码"),
        QR_LIMIT_SCENE("永久二维码"),
        QR_LIMIT_STR_SCENE("永久二维码");

        private String text;
    }

    @AllArgsConstructor
    @Getter
    enum WithdrawChannelEnum {

        WX(0, "微信", true),
        ALI_PAY(1, "支付宝", false),
        BANK_CARD(2, "银行卡", false),
        ;
        private Integer code;
        private String name;
        private Boolean enable;

        public static String getChannelName(Integer code) {
            for (WithdrawChannelEnum channelEnum : values()) {
                if (channelEnum.getCode().equals(code)) {
                    return channelEnum.getName();
                }
            }
            return "";
        }
    }

    /**
     * 类型 0、满减券,1、代金券,2、商品兑换券
     */
    @AllArgsConstructor
    @Getter
    enum CouponType {
        REDUCTION(0, "满减券"),
        VOUCHER(1, "代金券"),
        EXCHANGE(2, "商品兑换券"),
        ;

        private Integer code;
        private String name;
    }
}
